<template>
  <div class="container-big">
    <div style="padding-bottom: 336px;" class="container ">
      <div class="card-box">
        <div @click="myInvoice(item.id)" v-for="(item,ind) of table " :key="ind" class="card">
          <div class="card-head">
            <div class="card-head-bar" />
            <div class="card-head-con cenBet">
              <div>订单号：{{item.orderCode}}</div>
              <div>{{invoiceStatus[item.status]}}</div>
            </div>
          </div>
          <div class="card-con">
            <div class="card-con-list cenBet">
              <div>发票抬头</div>
              <div>{{item.headerType == 1?item.headerName:"个人"}}</div>
            </div>
            <div class="card-con-list cenBet">
              <div>发票金额</div>
              <div>{{item.totalPrice||0}}元</div>
            </div>
            <div class="card-con-list cenBet">
              <div>备注内容</div>
              <div>{{item.remark}}</div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import service from "@/api/invoice";
import invoiceStatus from "./invoiceStatus";
export default {
  data() {
    return {
      invoiceStatus: invoiceStatus,
      table: []
    };
  },
  created() {
    this.queryInvoiceListByMob();
  },
  methods: {
    async queryInvoiceListByMob() {
      this.$store.state.loading = true;
      const { data = [] } = await service.queryInvoiceListByMob({
        start: 0,
        size: 1000
      });
      this.$store.state.loading = false;
      this.table = data.data || [];
      if (!this.table.length) {
        this.$toast("暂无发票数据，请前往交易成功的订单详情中申请");
        return;
      }
    },
    myInvoice(id) {
      this.$router.push({
        name: "myInvoice",
        query: {
          id
        }
      });
    }
  }
};
</script>
<style scoped>
.card-box {
  width: 100%;
  height: auto;
  padding: 0px 5%;
}
.card {
  width: 100%;
  height: auto;
  /* min-height: 160px; */
  background: rgba(0, 0, 0, 0.4);
  /* border: 1px solid rgba(93, 93, 93, 0.2); */
  /* border: 1px solid #38383b; */
  margin-top: 26px;
  border-radius: 8px 8px 6px 6px;
  cursor: pointer;
}
.card-head {
  width: 100%;
  height: auto;
  padding-bottom: 13px;
  background: #282b31;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  position: relative;
}
.card-head-bar {
  width: 100%;
  height: 9px;
  opacity: 0.8;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  background-image: linear-gradient(-116deg, #3cb9ff 0%, #6044d4 100%);
}
.card-head-con {
  width: 100%;
  height: auto;
  padding: 16px 20px 6px 20px;

  font-size: 26px;
  color: #ffffff;
}
.card-con {
  width: 100%;
  height: auto;
  padding: 0px 18px;
}
.card-con-list {
  width: 100%;
  height: auto;
  min-height: 80px;
  font-size: 28px;
  color: #ffffff;
  padding: 16px 20px 6px 20px;
  border-bottom: 1px solid rgba(151, 151, 151, 0.2);
}
</style>
